<?php
/**
 * Created by PhpStorm.
 * User: root
 * Date: 17-6-19
 * Time: 上午10:47
 */

namespace App\Http\Controllers\Home;


use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use App\Message;

class GoodsController extends Controller
{
    public function goodsList($cid){
        //$username = parent::getSession();
        $goodslist = DB::table('goods')->where('cate_id',$cid)->orderBy('id','desc')->get();
        $category = DB::table('category')->where('pid',0)->get();
        return view('Home/Goods/goodslist')->with(['goodslist'=>$goodslist,'category'=>$category,'username'=>Message::getSession()]);
    }
}